#!/usr/bin/python3
# -*- coding: utf-8 -*-

"""
ZetCode PyQt5 tutorial

In this example, we create a simple
window in PyQt5.

author: Jan Bodnar
website: zetcode.com
Last edited: August 2017
"""

import sys
from PyQt5.QtWidgets import QApplication, QWidget
import torch
if __name__ == '__main__':


    # 这两个Tensor加减乘除会对b自动进行Broadcasting
    a = torch.rand(3, 1)
    b = torch.ones(4)
    print(a,  b)
    b[3] = 2

    c1 = a + b
    c2 = torch.add(a, b)
    print(c1)
    print(torch.all(torch.eq(c1, c2)))
    # app = QApplication(sys.argv)
    #
    # w = QWidget()
    # w.resize(250, 150)
    # w.move(300, 300)
    # w.setWindowTitle('111')
    # w.show()
    #
    # sys.exit(app.exec_())